

$import("Ext");

Ext.lib.Utils = {};

var libFlyweight;

Ext.lib.Utils.fly = function fly(el) {
        if (!libFlyweight) {
	        var Flyweight = Class.forName("Ext.Element").Flyweight;
            libFlyweight = new Flyweight();
        }
        libFlyweight.dom = el;
        return libFlyweight;
    }
    
    if(Ext.isIE) {
        function fnCleanUp() {
            var p = Function.prototype;
            delete p.createSequence;
            delete p.defer;
            delete p.createDelegate;
            delete p.createCallback;
            delete p.createInterceptor;

            window.detachEvent("onunload", fnCleanUp);
        }
        window.attachEvent("onunload", fnCleanUp);
    }